#
# Bulk uploader endpoint
#

from google.appengine.ext import bulkload
from google.appengine.api import datastore_types
from google.appengine.ext import search

class BeverageLoader(bulkload.Loader):
    def __init__(self):
        bulkload.Loader.__init__(self, 'Beverage',
                                 [('name', unicode),
                                  ('volume', int),
                                  ('caffeine_amount', int),
                                  ('caffeine_per_100ml', int)])

    def HandleEntity(self, entity):
        return search.SearchableEntity(entity)

if __name__ == '__main__':
    bulkload.main(BeverageLoader())
